import request from '@/utils/request'
const URL = '/iogames/_next/data/oL9vGiRFfIVITISs0dvte/index.json'

export async function getAllGames() {
  return request({
    url: URL,
    method: 'get'
  }).then((resp) => {
    return Promise.resolve(resp.pageProps.allGames)
  })
}

export async function getCategories() {
  return request({
    url: URL,
    method: 'get'
  }).then((resp) => {
    return Promise.resolve(resp.pageProps.categories)
  })
}
